/**
 * 求 array 通过 elementMapper 映射后元素的集合个数
 * @param array
 * @param elementMapper
 */
export function uniqueCountBy(array: any[], elementMapper: (element: any) => any): number {
  if (array == null || !array.length) return 0
  const set = new Set(array.map(elementMapper))
  return set.size
}
